<template>
  <div class="card">
    <div>
      <van-nav-bar
        title="我的名片"
        left-text=""
        left-arrow
        @click-left="onClickLeft"
      >
        <template #right>
          <van-icon
            name="search"
            size="18"
          />
        </template>
      </van-nav-bar>
    </div>
    <van-contact-edit
      is-edit
      show-set-default
      :contact-info="editingContact"
      set-default-label="设为默认联系人"
      @save="onSave"
      @delete="onDelete"
    />
  </div>
</template>

<script>
import { Toast } from 'vant'
export default {
  data() {
    return {
      editingContact: {}
    }
  },
  methods: {
    onClickLeft() {
      this.$router.push({ path: '/me' })
    },
    onSave(contactInfo) {
      Toast('保存')
    },
    onDelete(contactInfo) {
      Toast('删除')
    }
  }
}
</script>

<style>
</style>
